import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

/**
 * A player is an abstract class for HotSeatPlayer, AIPlayer, and maybe NetworkPlayer 
 * A player has a name, colour, meeples, score, and stats...one day
 * 
 * @author sam
 */
public /*abstract*/ class Player {

	static final public int NumberOfMeeples = 7; 
	static final public int RED = 0;
	
	public String name;
	public int colour;
	public int score;
	public Game game;
	
	private LinkedList<Meeple> meeples;
	//public Meeple meeples[];	
	
	public Player(String name, int colour, Game g)
	{
		this.name = name;		
		this.colour = colour;
		this.score = 0;
		this.game = g;
		
		meeples = new LinkedList<Meeple>();
		for(int i=0; i<NumberOfMeeples; i++)
			meeples.add(new Meeple(this));			
	}
	
	/// notify functions
	/// tell the player to have their turn
	public void playTurn(Tile t) throws InterruptedException
	{
		System.out.println("Not implemented!");
		System.exit(1);
	}	
	
	// access info..
	public boolean hasUnplayedMeeples()
	{
		return !meeples.isEmpty();
	}
	
	public int numberOfMeeplesLeft()
	{
		return meeples.size();
	}
	
	public Meeple getUnplayedMeeple()
	{
		// shouldn't get here if the player doesn't have any unplayed meeples
		assert(hasUnplayedMeeples());
		return meeples.pop();
	}
	
	public void returnMeeple(Meeple m)
	{
		meeples.push(m);
	}
}
